// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: 'cloud-dev-alpha-3f1k3'
})
const db = cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {
  console.log(event)
  return db.collection('card').where({
    start: event.start,
    end: event.end,
    offDate: event.offDate,
    offTime: event.offTime,
    cap: event.cap
  }).get({
    success: res=>{
      console.log("云端查询记录成功！")
    },
    fail: res=>{
      console.log("云端查询记录失败！！！")
    }
  })
}